FROM lizhi1803001230/jdk:1.8.0_202

ARG kafka_uid=kafka

COPY kafka_2.12-2.8.0 /opt/kafka_2.12-2.8.0
COPY cmak-3.0.0.5 /opt/cmak-3.0.0.5

COPY entrypoint.sh /opt/entrypoint.sh
RUN ln -s /opt/kafka_2.12-2.8.0 /opt/kafka && \
     useradd -ms /bin/bash ${kafka_uid} && \
     mkdir /etc/kafka-conf && \
     chown -R ${kafka_uid}:${kafka_uid} /etc/kafka-conf && \
     ln -s /opt/cmak-3.0.0.5 /opt/cmak && \
     chown -R ${kafka_uid}:${kafka_uid} /opt/cmak-3.0.0.5/
ENV KAFKA_HOME=/opt/kafka
ENV PATH=$KAFKA_HOME/bin:$PATH


ENTRYPOINT [ "/opt/entrypoint.sh" ]

USER ${kafka_uid}
